import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-27
 * Time: 15:31
 */
public class Test {
    public static void remove(int[] nums,int index,int usedSize){
        for (int i = index; i < usedSize-1; i++) {
            nums[i]=nums[i+1];
        }
    }
    public static int removeDuplicates(int[] nums){
        int usedSize=nums.length;
        int i=0;
        while(i<usedSize-1) {
            if (nums[i] == nums[i + 1]) {
                remove(nums, i + 1, usedSize);
                usedSize--;
                continue;
            }
            i++;
        }
        return usedSize;
    }
    public static void main(String[] args) {
        int[] nums={1,2};
        int len=removeDuplicates(nums);
        System.out.println(len);
    }
}
